package com.ywjt.pinkelephant.dynamic.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.stx.xhb.xbanner.XBanner;
import com.ywjt.pinkelephant.R;
import com.ywjt.pinkelephant.base.BaseActivity;
import com.ywjt.pinkelephant.dynamic.adapter.PodCastDetailAdapter;
import com.ywjt.pinkelephant.dynamic.model.MenauModel;

import java.util.ArrayList;
import java.util.List;

public class ActivityDistributeDetail extends BaseActivity implements View.OnClickListener {
    private XBanner banner;
    private List<Integer> banners;


    public static void actionStart(Context context ) {
        Intent intent = new Intent(context, ActivityDistributeDetail.class);
        context.startActivity(intent);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){

        }
    }

    @Override
    protected void init(Bundle savedInstanceState) {
        setAndroidNativeLightStatusBar(true);
    }

    @Override
    protected int setLayoutResourceID() {
        return R.layout.activity_distribute_detail;
    }

    @Override
    protected void initView() {
        setTitleText("视频分发");
        banner=findViewById(R.id.banner);
        banners=new ArrayList<>();
        banners.add(R.mipmap.icon_banner);
        banners.add(R.mipmap.icon_banner);
        banners.add(R.mipmap.icon_banner);
        banners.add(R.mipmap.icon_banner);
        banner.setData(R.layout.item_banner1,banners,null);
        banner.loadImage(new XBanner.XBannerAdapter() {
            @Override
            public void loadBanner(XBanner banner, Object object, View view, int position) {
                RelativeLayout container=(RelativeLayout) view;
                ImageView ivBanner=container.findViewById(R.id.ivBanner);
                Glide.with(ActivityDistributeDetail.this).load(banners.get(position))
                        .apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10)))
                        .into(ivBanner);
            }
        });

    }

    @Override
    protected void initData() { }

    /**
     * 获取要使用的标题栏样式(此函数由子类重写)
     * @return
     */
    @Override
    protected int getTitleBarType() {
        return 0;
    }

}
